<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <link rel="shortcut icon" href="images/logo.ico"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>油气田资料管理系统</title>
    <link rel="stylesheet" href="static/css/base.css">
    <link rel="stylesheet" href="static/css/platform.css">
    <link rel="stylesheet" href="static/easyui/themes/default/easyui.css">
    <link href="static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
    <link href="static/easyui/demo/demo.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="static/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/js/main.js"></script>
</head>
<body>
<div>
    <div class="container">
        <!--页面的头部信息  -->
        <div id="pf-hd">
            <div class="pf-logo">
                <div class="system-name">油气田资料管理系统</div>
            </div>
<!--            <a href="javascript:aiUpload()" id="aiUpload" class="easyui-linkbutton">智能上传</a>
            <a href="javascript:uploadFile()" id="uploadFile" class="easyui-linkbutton">普通上传</a>
            <a href="javascript:statImage()" id="statImage" class="easyui-linkbutton">统计分析</a>
            <a href="javascript:aiSearch()" id="aiSearch" class="easyui-linkbutton">AI检索</a>
            <a href="javascript:mapSearch()" id="mapSearch" class="easyui-linkbutton">地图检索</a>
            <a href="javascript:deleteDuplicate()" id="deleteDuplicate" class="easyui-linkbutton">重复文件删除</a>-->
            <!--顶部用户信息-->
            <div class="pf-user">
                <!--用户头像-->
                <div class="pf-user-photo">
                    <img src="static/images/main/user.png" alt="">
                </div>
                <!--用户名-->
                <h4 class="pf-user-name ellipsis"><label id="taxerName">张三</label></h4>
                <i class="iconfont xiala">&#xe607;</i>
                <!-- 头部用户信息 下拉菜单 -->
                <div class="pf-user-panel">
                    <ul class="pf-user-opt">
                        <li>
                            <a href="javascript:void(0);">
                                <i class="iconfont">&#xe60d;</i>
                                <span class="pf-opt-name personInfo">用户信息</span>
                            </a>
                        </li>
                        <li class="pf-modify-pwd">
                            <a href="javascript:void(0)">
                                <i class="iconfont">&#xe634;</i>
                                <span class="pf-opt-name updatePassword">修改密码</span>
                            </a>
                        </li>
                        <li class="pf-logout">
                            <a href="javascript:void(0);">
                                <i class="iconfont">&#xe60e;</i>
                                <span class="pf-opt-name exit">退出</span>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div><!-- 头部用户信息结束 -->

        <!-- 中间部分，也是主体部分 -->
        <div id="pf-bd">
            <div id="pf-sider">
                <!-- 系统菜单 标题-->
                <h2 class="pf-model-name">
                    <span class="iconfont">&#xe64a;</span>
                    <span class="pf-name">系统菜单</span>
                    <span class="toggle-icon"></span>
                </h2>
                <!-- 侧滑菜单开始 -->
                <ul class="sider-nav">
                    <li>
                        <a href="javascript:home();">
                            <span class="iconfont sider-nav-icon">&#xe620;</span>
                            <span class="sider-nav-title">首页</span>
                            <i class="iconfont">&#xe642;</i>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:statImage();">
                            <span class="iconfont sider-nav-icon">&#xe620;</span>
                            <span class="sider-nav-title">统计分析</span>
                            <i class="iconfont">&#xe642;</i>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:aiUpload()">
                            <span class="iconfont sider-nav-icon">&#xe62f;</span>
                            <span>智能上传</span>
                        </a>
<!--                        <a href="javascript:;">-->
<!--                            <span class="iconfont sider-nav-icon">&#xe625;</span>-->
<!--                            <span class="sider-nav-title">文件上传</span>-->
<!--                            <i class="iconfont">&#xe642;</i>-->
<!--                        </a>-->
<!--                        <ul class="sider-nav-s">-->
<!--                            <li class="active"><a href="javascript:uploadFile()">手动上传</a></li>-->
<!--                            <li><a href="javascript:aiUpload()">智能上传</a></li>-->
<!--                        </ul>-->
                    </li>
                    <li>
                        <a href="javascript:aiSearch();">
                            <span class="iconfont sider-nav-icon">&#xe62f;</span>
                            <span class="sider-nav-title">AI检索</span>
                            <i class="iconfont">&#xe642;</i>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:mapSearch();">
                            <span class="iconfont sider-nav-icon">&#xe647;</span>
                            <span class="sider-nav-title">地图检索</span>
                            <i class="iconfont">&#xe642;</i>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:deleteDuplicate();">
                            <span class="iconfont sider-nav-icon">&#xe611;</span>
                            <span class="sider-nav-title">文件去重</span>
                            <i class="iconfont">&#xe642;</i>
                        </a>
                    </li>
                    <li>
                        <a href="javascript:showMessage();">
                            <span class="iconfont sider-nav-icon">&#xe611;</span>
                            <span class="sider-nav-title">我的消息</span>
                            <i class="iconfont">&#xe642;</i>
                        </a>
                    </li>
                </ul>
            </div>

            <!-- 右侧显示部分 -->
            <div id="pf-page">
                <div class="easyui-tabs1" style="width:100%;height:100%;">
                    <div title="首页" style="padding:10px 5px 5px 10px;">
                        <iframe class="page-iframe" src="data_show.html" frameborder="no" border="no" height="100%"
                                width="100%" style="overflow: auto"></iframe>
                    </div>
                </div>
            </div>
        </div>

        <!-- 页面底部信息 -->
        <div id="pf-ft">
            <div class="system-name">
                <i class="iconfont">&#xe6fe;</i>
                <span>油气田资料管理系统&nbsp;v1.0</span>
            </div>
            <div class="copyright-name">
                <span>CopyRight&nbsp;2024&nbsp;&nbsp;tracy.com&nbsp;版权所有</span>
                <i class="iconfont">&#xe6ff;</i>
            </div>
        </div>
    </div>
    <div id="topWindow"></div>
</div>
<script type="text/javascript">
    $(function () {
        $('.easyui-tabs1').tabs({
            tabHeight: 44,
            onSelect: function (title, index) {
                var currentTab = $('.easyui-tabs1').tabs("getSelected");
                if (currentTab.find("iframe") && currentTab.find("iframe").size()) {
                    currentTab.find("iframe").attr("src", currentTab.find("iframe").attr("src"));
                }
            }
        });
    });

    function addTab(title, url) {
        /* 功能是第一次点击打开tab页就打开一个tab页，当没关闭这个tab页，又去另外一个tab页操作，再回来刚才的tab页后就不用打开另外一个和刚才一样的tab页，而是同一个tab页。 */
        if ($('.easyui-tabs1').tabs('exists', title)) {
            $('.easyui-tabs1').tabs('select', title);
        } else {
            var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;overflow:auto;"></iframe>';
            $('.easyui-tabs1').tabs('add', {
                title: title,
                content: content,
                closable: true
            });
        }
    }

    /* 打开在父窗口中打开window */
    function openTopWindow(options) {
        options = !options ? {} : options;
        options.width = !options.width ? 500 : options.width;
        options.height = !options.height ? 400 : options.height;
        options.url = !options.url ? "404.html" : options.url;
        options.title = !options.title ? "" : options.title;

        parent.$("#topWindow").window({
            title: options.title,
            width: options.width,
            height: options.height,
            content: "<iframe scrolling='no' frameborder='0' border='0' height='100%' width='100%' src='" + options.url + "'></iframe>",
            modal: true,
            resizable: false,
            collapsible: false
        });
    }

    function append() {
        $.messager.alert("提示", "创建成功", "info");
    }

    function removeFolder() {
        $.messager.confirm("警告", "确认删除？此操作将移除全部子文件", function (data) {
            if (data) {
                $.messager.alert("提示", "删除成功", "info")
            }
        })
    }

    function removeFile() {
        $.messager.confirm("警告", "确认删除？", function (data) {
            if (data) {
                $.messager.alert("提示", "删除成功", "info")
            }
        })
    }

    function home() {
        addTab("首页", "data_show.html")
    }

    function aiUpload() {
        addTab("智能上传", "aiUpload.html")
    }

    function uploadFile() {
        addTab("上传文件", "uploadFile.html")
    }

    function statImage() {
        addTab("统计分析", "statAnalysis.html")
    }

    function aiSearch() {
        addTab("AI检索", "aiSearch.html")
    }

    function mapSearch() {
        addTab("地图检索", "amap.html")
    }

    function deleteDuplicate() {
        addTab("重复文件", "deleteDuplicate.html")
    }

    function showMessage() {
        addTab("我的消息", "showMessage.html")
    }
    function generateMessages(count) {
        var messages = [];
        for (var i = 1; i <= count; i++) {
            var message = {
                order: i,
                title: getRandomTitle(),
                content: getRandomContent(),
                receiveTime: getRandomReceiveTime(),
                sender: getRandomSender(),
                isRead: getRandomIsRead()
            };
            messages.push(message);
        }
        return messages;
    }

    function getRandomIsRead() {
        return Math.random() < 0.5 ? '未读' : '已读';
    }

    function getRandomTitle() {
        var titles = [
            '恭喜您中得彩票大奖！',
            '您的火车票已预订成功',
            '您的飞机票已确认',
            '欢迎入学，新生报道指南',
            '重要通知：请下载最新版本的软件'
        ];
        return titles[Math.floor(Math.random() * titles.length)];
    }

    function getRandomContent() {
        var contents = [
            '尊敬的用户，您已中得彩票一等奖，奖金为一百万元。请点击<a href="http://example.com/lottery">此处</a>领取。',
            '尊敬的客户，您预订的火车票已确认。请于出发前一小时到达车站，<a href="http://example.com/train-ticket">点击这里</a>查看您的电子车票。',
            '您的航班已确认，起飞时间为明天上午十点。请提前两小时到达机场办理登机手续。<a href="http://example.com/flight-details">点击这里</a>查看航班详情。',
            '亲爱的新生，欢迎来到我们的大学。请点击<a href="http://example.com/new-student-guide">此处</a>下载新生报道手册。',
            '尊敬的用户，我们注意到您正在使用过期的软件版本。为了更好的体验，请<a href="http://example.com/download-update">点击这里</a>下载最新版本。'
        ];
        return contents[Math.floor(Math.random() * contents.length)];
    }

    function getRandomReceiveTime() {
        var today = new Date();
        var timeDiff = Math.random() * (today - new Date(2023, 0, 1));
        return new Date(today - timeDiff).toLocaleString();
    }

    function getRandomSender() {
        var senders = ['彩票中心', '火车票务系统', '航空公司', '大学招生办公室', '软件更新服务'];
        return senders[Math.floor(Math.random() * senders.length)];
    }


    // 假设的文件名
    const fileName = '油田资料报告.pdf';

    // 创建一个对象，其中每个键都有相同的文件名
    const filesObj = {};
    for (let i = 1; i <= 10; i++) {
        filesObj[`文件${i}`] = fileName;
    }

    // 将对象转换为数组，并过滤掉值为空的项
    const filesArray = Object.entries(filesObj).filter(([key, value]) => value !== '');

    console.log(filesArray);
</script>
</body>
</html>
